' T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%
 
 ' Q%          N a m e :   C M _ E n d o R o b o _ 1 4 . t x t                         D a t e :   0 7   J u l   2 0 2 4   Q%
 
 ' Q%      A u t h o r :   T h e r e m i n o   T e a m   /   L e o n a r d o                                               Q%
 
 ' Q%        S c o p e :   T e s t   s t e p p e r   m o t o r   s e q u e n c e s                                         Q%
 
 ' `%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%c%
 
 ' Q%H a r d w a r e :   M A s t e r   V 5                         P o w e r :   2 4   V o l t                             Q%
 
 ' _% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %b%
 
 ' Q%      M o t o r   1       I n   O U T             S t e p p e r   D r i v e r :   S L 2 2 3 6 A                       Q%
 
 ' Q%      O u k e d a   O K 4 2 S T H 4 0 - 1 6 8 4 A G 5           r e d u c t i o n   5 . 1 8 : 1                       Q%
 
 ' Q%              c u r r e n t                     m i c r o s t e p                                                     Q%
 
 ' Q%      1       2       3       4             5       6       7       8                                                 Q%
 
 ' Q%    O F F     O N     O N   O F F         O F F   O F F     O N     O N     1 . 1 A     1 6 0 0   s t e p s / 3 6 0   Q%
 
 ' Q%  M a s t e r       s t e p   p e r   m m   =   2 6 . 7 2                                                             Q%
 
 ' _% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %b%
 
 ' Q%      M o t o r   2       R O T A T I O N         S t e p p e r   D r i v e r :   S L 2 2 3 6 A                       Q%
 
 ' Q%      S H E N L I   D L E 4 2 - 2 5 - J 8 - S 2 4 8 A 1 0 8           r e d u c t i o n   2 5 : 1                     Q%
 
 ' Q%              c u r r e n t                     m i c r o s t e p                                                     Q%
 
 ' Q%      1       2       3       4             5       6       7       8                                                 Q%
 
 ' Q%    O F F     O N     O N   O F F         O F F   O F F     O N     O N     1 . 1 A     1 6 0 0   s t e p s / 3 6 0   Q%
 
 ' Q%  M a s t e r       s t e p   p e r   m m   =   2 6 . 7 2                                                             Q%
 
 ' Q%  P o w e r :   2 4   V                                                                                               Q%
 
 ' _% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %b%
 
 ' Q%I S O       C u l t u r e     G e n d e r       A g e           N a m e                                               Q%
 
 ' _% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %b%
 
 ' Q%E N G       E N - U S         M a l e           A d u l t       M i c r o s o f t   D a v i d   D e s k t o p         Q%
 
 ' Q%E N G       E N - U S         F e m a l e       A d u l t       M i c r o s o f t   Z i r a   D e s k t o p           Q%
 
 ' Q%I T A       I T - I T         F e m a l e       A d u l t       M i c r o s o f t   E l s a   D e s k t o p           Q%
 
 ' Q%J P N       J A - J P         F e m a l e       A d u l t       M i c r o s o f t   H a r u k a   D e s k t o p       Q%
 
 ' Q%Z H O       Z H - C N         F e m a l e       A d u l t       M i c r o s o f t   H u i h u i   D e s k t o p       Q%
 
 ' Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%
 
 O p t i o n   S p e e d   8 
 
 B e e p   " 2 5 0 0   2 0 ,   1 5 0 0   1 0 0 " 
 
 L o a d   i m a g e s \ R o t a t i o n _ s h a f t . j p g 
 
 T T S   S e l e c t V o i c e   " E N G " 
 
 s 1   =   T T S v o i c e s 
 
 T T S   S e t V o l u m e   1 0 0 
 
 T T S   S e t S p e e d   - 2 
 
 T T S   S e l e c t V o i c e   3 
 
 ' T T S   S p e a k   " T h e r e m i n o   A u t o m a t i o n   p r o g r a m m i n g   l a n g u a g e   i s   r u n n i n g . " 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%
 
 '   Q%  S L O T   T E X T   f o r   C O M M A N D S   a n d   R E S P O N S E S               Q%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%
 
 ' V a r i a b l e   N u m e r i c   S l o t _ C o m m a n d s T o M o t o r s             =   5 0 
 
 V a r i a b l e   N u m e r i c   S l o t _ C o m m a n d s T o C o b o t               =   5 1 
 
 V a r i a b l e   N u m e r i c   S l o t _ R e s p o n s e s F r o m C o b o t         =   5 2 
 
 V a r i a b l e   N u m e r i c   S l o t _ E x t e r n a l C o m m a n d s             =   5 3 
 
 ' V a r i a b l e   N u m e r i c   S l o t _ W o r d R e c o g n i z e d                 =   5 5 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%  %%%%  %      %%%%  %%%%%
 
 '   Q%  S L O T   I N I T I A L I Z A T I O N S                                               Q%  %%%%  %      %    %      %
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%  %%%%  %%%  %%%%      %
 
 V a r i a b l e   N u m e r i c   S l o t _ M 1 _ I n O u t D e s t i           =   1 0 1 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 1 _ I n O u t P o s i t           =   1 0 2 
 
 V a r i a b l e   N u m e r i c   S l o t _ L i m i t O u t                     =   1 0 3 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 2 _ R o t D e s t i n a           =   1 5 1 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 2 _ R o t P o s i t i o           =   1 5 2 
 
 V a r i a b l e   N u m e r i c   S l o t _ L i m i t R o t                     =   1 5 3 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 3 _ T i p D e s t i n a           =   2 0 1 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 3 _ T i p P o s i t i o           =   2 0 2 
 
 ' V a r i a b l e   N u m e r i c   S l o t _ L i m i t T i p                     =   2 0 3 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 4 _ E l e v D e s t i n           =   2 5 1 
 
 V a r i a b l e   N u m e r i c   S l o t _ M 4 _ E l e v P o s i t i           =   2 5 2 
 
 V a r i a b l e   N u m e r i c   S l o t _ L i m i t E l e v                   =   2 5 3 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y P a d X                     =   5 0 0 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y P a d Y                     =   5 0 1 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y P a d S p e e d             =   5 0 2 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y P a d T                     =   5 0 3 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y P a d 8 W                   =   5 0 6 
 
 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y B t n 1                     =   5 1 0 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y B t n 2                     =   5 1 1 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y B t n 3                     =   5 1 2 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y B t n 4                     =   5 1 3 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y B t n 5                     =   5 1 4 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y B t n 6                     =   5 1 5 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y B t n 7                     =   5 1 6 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y B t n 8                     =   5 1 7 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y B t n 9                     =   5 1 8 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y B t n 1 0                   =   5 1 9 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y B t n 1 1                   =   5 2 0 
 
 V a r i a b l e   N u m e r i c   S l o t _ J o y B t n 1 2                   =   5 2 1 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ S t a r t S t o p V i d e o       =   5 2 0 
 
 V a r i a b l e   N u m e r i c   S l o t _ S a v e V i d e o                 =   5 2 1 
 
 V a r i a b l e   N u m e r i c   S l o t _ T a k e I m a g e                 =   5 2 2 
 
 
 
 V a r i a b l e   N u m e r i c   J o y P a d _ D e a d B a n d               =   3 0 
 
 V a r i a b l e   N u m e r i c   J o y P a d _ S p e e d                     =   5 0 
 
 V a r i a b l e   N u m e r i c   K e y J o g _ S p e e d                     =   5 0 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ L e d R                             =     7 
 
 V a r i a b l e   N u m e r i c   S l o t _ L e d G                             =     8 
 
 V a r i a b l e   N u m e r i c   S l o t _ L e d B                             =     9 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ M o t o r s O f f         =   6 0 
 
 V a r i a b l e   N u m e r i c   S l o t _ S i g n a l S c o p e         =   1 3 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%  %%%%  %    %  %%%%%
 
 '   Q%  B U T T O N S                                                                         Q%  %%%%  %    %      %
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%  %%%%  %%%%      %
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - E n d   m o t o r   M 1 
 
 B u t t o n   1   L a b e l   M 1 _ I N _ O U T 
 
 B u t t o n   M 1 _ I N _ O U T   T e x t   " M 1 "   +   C R L F   +   " I N / O U T " 
 
 B u t t o n   M 1 _ I N _ O U T   C o l o r   S t e e l B l u e 
 
 
 
 B u t t o n   2   L a b e l   M 1 _ D e s t i n a t i o n 
 
 B u t t o n   M 1 _ D e s t i n a t i o n   T e x t   " D e s t i n a t i o n " 
 
 
 
 B u t t o n   3   L a b e l   M 1 _ P o s i t i o n 
 
 B u t t o n   M 1 _ P o s i t i o n   T e x t   " P o s i t i o n " 
 
 
 
 B u t t o n   4   L a b e l   M 1 _ H o m e 
 
 B u t t o n   M 1 _ H o m e   T e x t   " H o m e " 
 
 B u t t o n   M 1 _ H o m e   C o l o r   Y e l l o w 
 
 
 
 B u t t o n   5   L a b e l   M 1 _ A r b i t r a r y 
 
 B u t t o n   M 1 _ A r b i t r a r y   T e x t   " A r b i t r a r y " 
 
 B u t t o n   M 1 _ A r b i t r a r y   C o l o r   C y a n 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - E n d   m o t o r   M 1 
 
 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - B e g i n   m o t o r   M 2 
 
 B u t t o n   1 7   L a b e l   M 2 _ R o t a t i o n 
 
 B u t t o n   M 2 _ R o t a t i o n   T e x t   " M 2 "   +   C R L F   +   " R O T A T I O N " 
 
 B u t t o n   M 2 _ R o t a t i o n   C o l o r   S t e e l B l u e 
 
 
 
 B u t t o n   1 8   L a b e l   M 2 _ D e s t i n a t i o n 
 
 B u t t o n   M 2 _ D e s t i n a t i o n   T e x t   " D e s t i n a t i o n " 
 
 
 
 B u t t o n   1 9   L a b e l   M 2 _ P o s i t i o n 
 
 B u t t o n   M 2 _ P o s i t i o n   T e x t   " P o s i t i o n " 
 
 
 
 B u t t o n   2 0   L a b e l   M 2 _ H o m e 
 
 B u t t o n   M 2 _ H o m e   T e x t   " H o m e " 
 
 B u t t o n   M 2 _ H o m e   C o l o r   Y e l l o w 
 
 
 
 B u t t o n   2 1   L a b e l   M 2 _ A r b i t r a r y 
 
 B u t t o n   M 2 _ A r b i t r a r y   T e x t   " A r b i t r a r y " 
 
 B u t t o n   M 2 _ A r b i t r a r y   C o l o r   C y a n 
 
 ' ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - E n d   m o t o r   M 2 
 
 ' 
 
 ' ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - B e g i n   m o t o r   M 3 
 
 B u t t o n   3 3   L a b e l   M 3 _ T i p 
 
 B u t t o n   M 3 _ T i p   T e x t   " M 3 "   +   C R L F   +   " T i p " 
 
 B u t t o n   M 3 _ T i p   C o l o r   S t e e l B l u e 
 
 
 
 B u t t o n   3 4   L a b e l   " M 3 _ D e s t i n a t i o n " 
 
 B u t t o n   M 3 _ D e s t i n a t i o n   T e x t   " D e s t i n a t i o n " 
 
 
 
 B u t t o n   3 5   L a b e l   M 3 _ P o s i t i o n 
 
 B u t t o n   M 3 _ P o s i t i o n   T e x t   " P o s i t i o n " 
 
 
 
 B u t t o n   3 6   L a b e l   M 3 _ H o m e 
 
 B u t t o n   M 3 _ H o m e   T e x t   " H o m e " 
 
 B u t t o n   M 3 _ H o m e   C o l o r   Y e l l o w 
 
 
 
 B u t t o n   3 7   L a b e l   M 3 _ A r b i t r a r y 
 
 B u t t o n   M 3 _ A r b i t r a r y   T e x t   " A r b i t r a r y " 
 
 B u t t o n   M 3 _ A r b i t r a r y   C o l o r   C y a n 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - E n d   m o t o r   M 3 
 
 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - B e g i n   m o t o r   M 4 
 
 B u t t o n   4 9   L a b e l   M 4 _ E l e v a t i o n 
 
 B u t t o n   M 4 _ E l e v a t i o n   T e x t     " M 4 "   +   C R L F   +   " E L E V A T I O N " 
 
 B u t t o n   M 4 _ E l e v a t i o n   C o l o r   S t e e l B l u e 
 
 
 
 B u t t o n   5 0   L a b e l   " M 4 _ D e s t i n a t i o n " 
 
 B u t t o n   M 4 _ D e s t i n a t i o n   T e x t   " D e s t i n a t i o n " 
 
 
 
 B u t t o n   5 1   L a b e l   M 4 _ P o s i t i o n 
 
 B u t t o n   M 4 _ P o s i t i o n   T e x t   " P o s i t i o n " 
 
 
 
 B u t t o n   5 2   L a b e l   M 4 _ H o m e 
 
 B u t t o n   M 4 _ H o m e   T e x t   " H o m e " 
 
 B u t t o n   M 4 _ H o m e   C o l o r   Y e l l o w 
 
 
 
 B u t t o n   5 3   L a b e l   M 4 _ A r b i t r a r y 
 
 B u t t o n   M 4 _ A r b i t r a r y   T e x t   " A r b i t r a r y " 
 
 B u t t o n   M 4 _ A r b i t r a r y   C o l o r   C y a n 
 
 ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - E n d   m o t o r   M 4 
 
 
 
 B u t t o n   9   L a b e l   M o t o r s _ E n a b l e 
 
 B u t t o n   M o t o r s _ E n a b l e   T e x t   " M o t o r s   O N " 
 
 B u t t o n   M o t o r s _ E n a b l e   C o l o r   L i m e 
 
 
 
 B u t t o n   2 5   L a b e l   S e q u e n c e 
 
 B u t t o n   S e q u e n c e   T e x t   " S e q u e n c e " 
 
 B u t t o n   S e q u e n c e   C o l o r   M e d i u m B l u e 
 
 
 
 B u t t o n   2 6   L a b e l   V o i c e O u t p u t O n O f f 
 
 B u t t o n   V o i c e O u t p u t O n O f f   T e x t   " V o i c e   o u t p u t   O N " 
 
 B u t t o n   V o i c e O u t p u t O n O f f   C o l o r   G r e e n 
 
 
 
 B u t t o n   4 1   L a b e l   R e c o g n i z e E n c o d e r 
 
 B u t t o n   R e c o g n i z e E n c o d e r     T e x t   " R e c o g n i z e "   +   C R L F   +   " E n c o d e r " 
 
 B u t t o n   R e c o g n i z e E n c o d e r     C o l o r   L i g h t B l u e 
 
 
 
 B u t t o n   4 2   L a b e l   J o y P a d _ E n a b l e 
 
 B u t t o n   J o y P a d _ E n a b l e   T e x t   " J o y P a d   O F F " 
 
 B u t t o n   J o y P a d _ E n a b l e   C o l o r   R e d 2 
 
 
 
 B u t t o n   5 7   L a b e l   A l l Z e r o 
 
 B u t t o n   A l l Z e r o   T e x t   " M a i n   H o m e " 
 
 B u t t o n   A l l Z e r o   C o l o r   Y e l l o w 
 
 
 
 B u t t o n   1 0   L a b e l   S a y 
 
 B u t t o n   S a y   T e x t   " S a y " 
 
 B u t t o n   S a y   C o l o r   D e e p S k y B l u e 
 
 
 
 B u t t o n   1 1   L a b e l   C l o s e A l l 
 
 B u t t o n   C l o s e A l l   T e x t   " C L O S E   A L L " 
 
 B u t t o n   C l o s e A l l   C o l o r   R e d 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%  %      %%%%  %%%%  %%%%
 
 '   Q%  L O A D   A P P S                                                                     Q%  %      %    %  %%%%  %    %
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%  %%%  %%%%  %    %  %%%%
 
 L o a d   T h e r e m i n o _ H A L . e x e 
 
 L o a d   T h e r e m i n o _ G a m e P a d . e x e 
 
 L o a d   T h e r e m i n o _ S l o t V i e w e r . e x e 
 
 L o a d   T h e r e m i n o _ S l o t V i e w e r _ S T R . e x e 
 
 L o a d   T h e r e m i n o _ S l o t V i e w e r _ P A D . e x e 
 
 
 
 ' L o a d   T h e r e m i n o _ V o i c e C o m m a n d s . e x e 
 
 
 
 L o a d   T h e r e m i n o _ S i g n a l S c o p e . e x e 
 
 
 
 L o a d   T h e r e m i n o _ C o b o t . e x e 
 
 ' W a i t A p p l i c a t i o n s S t a r t e d 
 
 L o a d   H i d e 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%    %%%%  %%%%%  %%%%%  %%%%%  %%%%%
 
 '   Q%    E X E C U T I O N   S T A R T   F R O M   H E R E                                   Q%    %%%%      %      %%%%%  %%%%%      %
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%    %%%%      %      %      %  %    %%      %
 
 ' R e s e t E n c o d e r s 
 
 S l o t ( S l o t _ S i g n a l S c o p e )   =   1 0 0 0 
 
 S l o t ( S l o t _ M o t o r s O f f )   =   0       ' A l l   m o t o r s   E n a b l e d 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - -   G O T O   H o m i n g   -   C o m m a n d   t o   C o b o t 
 
 W a i t C o b o t R e a d y 
 
 ' S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( " G o t o H o m i n g " ) 
 
 
 
 C o n t r o l s   O p e n T e x t B o x 
 
 C o n t r o l s   C l e a r T e x t B o x 
 
 
 
 ' A l l Z e r o 
 
 
 
 L o o p 
 
 
 
 S t o p 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%  %      %%%%  %%%%  %%%%
 
 '   Q%  L O O P                                                                               Q%  %      %    %  %    %  %%%%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%  %%%  %%%%  %%%%  %
 
 L a b e l   L o o p 
 
 	 ' I n t e r p r e t a t e V o i c e C o m m a n d s 
 
         ' E n c o d e r 
 
 	 
 
 	 I f   S l o t ( 0 )   =   - 2 
 
 	 	 P r i n t   " M a s t e r   d i s c o n n e c t e d . " 
 
 	 	 E n d 
 
 	 E n d I f 
 
 	 U p d a t e P o s i t i o n s 
 
 	 C h e c k S t a t u s J o y P a d 
 
 	 J o y P a d 
 
 G o t o   L o o p 
 
 S t o p 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%
 
 '   Q%  E N A B L E / D I S A B L E   B U T T O N S                                           Q%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%
 
 V a r i a b l e   N u m e r i c   E A B 
 
 L a b e l   E n a b l e A l l B u t t o n s 
 
 	 F o r   E A B   =   1   T o   6 4 
 
 	 	 B u t t o n   E A B   E n a b l e d 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 V a r i a b l e   N u m e r i c   D A B 
 
 L a b e l   D i s a b l e A l l B u t t o n s 
 
 	 F o r   D A B   =   1   T o   6 4 
 
 	 	 B u t t o n   D A B   D i s a b l e d 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   T E S T   M A S T E R   P R E S E N T 
 
 F o r   v 1   =   1   T o   9 e 9 9 
 
 	 F o r   v 2   =   1   T o   2 0   '   < < <   t e s t i n g   f o r   2   s e c o n d s 
 
 	 	 I f   ( S l o t ( 0 )   > =   1   A n d   S l o t ( 0 )   < =   3 )   O r   K e y ( " C T R L " ) 
 
 	 	 	 E x i t   2 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 N e x t 
 
 	 P r i n t   "   I n v a l i d   m a s t e r   n u m b e r :   "   +   S l o t ( 0 ) 
 
 	 S l o t   0   =   R e c o g n i z e 
 
 	 B e e p 
 
 N e x t 
 
 P r i n t   " " 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%
 
 '   Q%    W A I T   C O B O T   R E A D Y                                                     Q%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%
 
 L a b e l   W a i t C o b o t R e a d y 
 
 	 V a r i a b l e   N u m e r i c   W C R 1 
 
 	 F o r   W C R 1   =   1   T o   I n f i n i t y 
 
 	 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 	 I f   S l o t T e x t ( S l o t _ R e s p o n s e s F r o m C o b o t )   =   " R e a d y " 
 
 	 	 	 E x i t 
 
 	 	 E n d I f 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%  %%%%  %%%%%  %%%%  %%%%
 
 '   Q%  S T O P   E V E N T   ( w h e n   p r e s s i n g   s t o p   b u t t o n )           Q%  %%%%      %      %    %  %%%%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%  %%%%      %      %%%%  %
 
 L a b e l   E v e n t S t o p 
 
 	 S t o p C o b o t 
 
 	 S l o t ( S l o t _ S i g n a l S c o p e )   =   0 
 
 E n d 
 
 
 
 L a b e l   G o t o S a f e P o s i t i o n 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( " G o t o H o m i n g " ) 
 
 R e t u r n 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%  %%%  %      %%%%  %%%%  %%%%
 
 '   Q%  C L O S E   A L L             ( w h e n   p r e s s i n g   X   o n   f o r m )       Q%  %      %      %    %  %%%%  %%%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%  %%%  %%%  %%%%  %%%%  %%%%
 
 L a b e l   C l o s e A l l 
 
 	 S t o p C o b o t 
 
 	 S l o t ( S l o t _ S i g n a l S c o p e )   =   0 
 
 	 L o a d   C l o s e A l l 
 
 E n d 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     S E N D   C O M M A N D   ( d e f a u l t   t i m e o u t   =   0 . 5   S e c ) 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   S e n d C o m m a n d 	 	 	 ' ( D e s t i n a t i o n   S l o t ) ( C o m m a n d   S t r i n g ) 
 
 	 V a r i a b l e   N u m e r i c   S C 1 
 
 	 V a r i a b l e   S t r i n g     S C 2 
 
 	 V a r i a b l e   N u m e r i c   S C 3   =   0 . 5   ' < - -   T h e   t i m e o u t   i n   s e c o n d s 
 
 	 V a r i a b l e   N u m e r i c   S C 4 
 
 	 S l o t T e x t   S C 1   =   S C 2 
 
 	 F o r   S C 4   =   0 . 1   T o   S C 3   S t e p   0 . 1 
 
 	 	 I f   S l o t T e x t ( S C 1 )   =   " " 
 
 	 	 	 E x i t 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     C O M M A N D S   t o   C o b o t 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   E x e c C o b o t 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( " E n a b l e R e p e a t " ) 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( " S e l e c t L i n e   1 " ) 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( " S t a r t E x e c u t i o n " ) 
 
 R e t u r n 
 
 
 
 L a b e l   S t o p C o b o t 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( " S t o p E x e c u t i o n " ) 
 
 R e t u r n 
 
 
 
 L a b e l   A r r o w U p C o b o t 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( " A r r o w U p " ) 
 
 R e t u r n 
 
 
 
 L a b e l   A r r o w D o w n C o b o t 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( " A r r o w D o w n " ) 
 
 R e t u r n 
 
 
 
 L a b e l   E x e c u t e C o b o t F r o m S e l e c t e d L i n e 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( " S t a r t E x e c u t i o n " ) 
 
 R e t u r n 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%  %%%%  %    %  %%%
 
 '   Q%    S   U   B   R   O   U   T   I   N   E       A   R   E   A                           Q%  %%%%  %    %  %%%%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%  %%%%  %%%%  %%%%
 
 L a b e l   R e c o g n i z e E n c o d e r 
 
 	 S l o t ( 0 )   =   R e c o g n i z e 
 
 R e t u r n 
 
 
 
 L a b e l   M o t o r s _ E n a b l e 
 
 	 ' S l o t ( S l o t _ S i g n S c o p e )   =   1 0 0 0 
 
 	 
 
 	 I f   S l o t ( S l o t _ M o t o r s O f f )   =   1 0 0 0 
 
 	 	 B u t t o n   M o t o r s _ E n a b l e   T e x t   " M o t o r s   O N " 
 
 	 	 S l o t ( S l o t _ M o t o r s O f f )   =   0 
 
 	 	 B u t t o n   M o t o r s _ E n a b l e   C o l o r   F l a s h i n g   L i m e   L i g h t G r e e n 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 E l s e 
 
 	 	 B u t t o n   M o t o r s _ E n a b l e   T e x t   " M o t o r s   O F F " 
 
 	 	 S l o t ( S l o t _ M o t o r s O f f )   =   1 0 0 0 
 
 	 	 B u t t o n   M o t o r s _ E n a b l e   C o l o r   F l a s h i n g   R e d     R e d 4 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 L a b e l   E n a b l e M o t o r s 
 
 	 S l o t ( S l o t _ M o t o r s O f f )   =   0 
 
 R e t u r n 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%
 
 '   Q%    A   R   B   I   T   R   A   R   Y                                                   Q%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%
 
 L a b e l   M 1 _ A r b i t r a r y 
 
 	 v 1   =   I n p u t   " I n s e r t   D e s t i n a t i o n   v a l u e   ( m a x   2 1 0 0 )   i n   d e c   o f   m m :   " 
 
 	 P r i n t   v 1 
 
 	 S l o t ( S l o t _ M 1 _ I n O u t D e s t i )   =   V 1 
 
 R e t u r n 
 
 
 
 L a b e l   M 2 _ A r b i t r a r y 
 
 	 v 1   =   I n p u t   " I n s e r t   D e s t i n a t i o n   v a l u e   i n   d e g r e e   ( m a x 3 3 0 ) : " 
 
 	 S l o t ( S l o t _ M 2 _ R o t D e s t i n a )   =   V 1 
 
 R e t u r n 
 
 
 
 L a b e l   M 3 _ A r b i t r a r y 
 
 	 v 1   =   I n p u t   " I n s e r t   D e s t i n a t i o n   v a l u e   ( m a x   1 1 0 )   i n   d e g r e e : " 
 
 	 P r i n t   v 1 
 
 	 S l o t ( S l o t _ M 3 _ T i p D e s t i n a )   =   V 1 
 
 R e t u r n 
 
 
 
 L a b e l   M 4 _ A r b i t r a r y 
 
 	 v 1   =   I n p u t   " I n s e r t   D e s t i n a t i o n   v a l u e   ( m a x   x x x )   i n   d e c   o f   m m : " 
 
 	 P r i n t   v 1 
 
 	 S l o t ( S l o t _ M 4 _ E l e v D e s t i n )   =   V 1 
 
 R e t u r n 
 
 
 
 L a b e l   S e q u e n c e 
 
 	 E n a b l e M o t o r s 
 
 	 ' 	 R e c o g n i z e E n c o d e r 
 
 	 ' T T S   S p e a k   " S t a r t   e x e c u t i o n   o f   a   t e s t " 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( " D i s a b l e R e p e a t " ) 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( " L o a d S e q u e n c e   S e q u e n c e _ V o i c e . t x t " ) 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( " S e l e c t L i n e   1 " ) 
 
 	 ' S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( " S t a r t E x e c u t i o n " ) 
 
 R e t u r n 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%    %%%%  %%%%  %%  %%      %%%    %%%%  %%%%  %%%
 
 '   Q%    C O M M A N D S   F R O M   C O B O T         Q%    %        %    %  %  %  %      %%      %        %    %  %%%%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%    %%%%  %%%%  %      %  %  %    %  %%%%  %%%%  %%%%
 
 L a b e l   E v e n t _ E x t e r n a l C o m m a n d s 
 
 	 S e l e c t   G e t S e p a r a t e d S t r i n g ( C o m m a n d T e x t ,   0 ) 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   A C T I O N S 
 
 	 	 C a s e   " S a y " 
 
 	 	 	 T T S   S p e a k   M i d ( C o m m a n d T e x t ,   5 ) 
 
 	 	 	 C l e a r C o m m a n d 
 
 	 	 C a s e   " S a y W " 
 
 	 	 	 T T S   S p e a k   M i d ( C o m m a n d T e x t ,   5 ) 
 
 	 	 	 W a i t   T T S r e a d y 
 
 	 	 	 C l e a r C o m m a n d 
 
 	 	 	 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S T A R T / S T O P   V o i c e 
 
 	 	 C a s e   " S t a r t V o i c e " 
 
 	 	 	 S t a r t V o i c e 
 
 	 	 	 C l e a r C o m m a n d 
 
 	 	 C a s e   " S t o p V o i c e " 
 
 	 	 	 S t o p V o i c e 
 
 	 	 	 C l e a r C o m m a n d 
 
 	 	 	 
 
 	 	 	 
 
 	 	 C a s e   " B e e p " 
 
 	 	 	 B e e p   8 8 0 - 1 0 0 
 
 	 	 	 C l e a r C o m m a n d 
 
 	 	 C a s e   " P a u s e " 
 
 	 	 	 W a i t   S e c o n d s   G e t S e p a r a t e d S t r i n g ( C o m m a n d T e x t ,   1 ) 
 
 	 	 	 C l e a r C o m m a n d 
 
 	 	 	 
 
 	 	 ' C a s e   " S p e e d " 
 
 	 	 ' 	 S e t M o t o r s _ S P E E D 
 
 	 	 ' 	 C l e a r C o m m a n d 
 
 	 	 	 
 
 	 	 C a s e   " E x e c u t i n g " 
 
 	 	 	 C l e a r C o m m a n d 
 
 	 	 	 
 
 	 	 C a s e E l s e 
 
 	 	 	 C o n t r o l s   O p e n T e x t B o x 
 
 	 	 	 P r i n t   C R L F   +   "   U n r e c o g n i z e d   c o m m a n d :   "   +   C o m m a n d T e x t   +   C R L F 
 
 	 	 	 B e e p 
 
 	 	 	 C l e a r C o m m a n d 
 
 	 	 	 S t o p 	 	 	 	 	 	 	 	 ' 
 
 	 E n d S e l e c t 
 
 R e t u r n 
 
 
 
 L a b e l   C l e a r C o m m a n d 
 
 	 S l o t T e x t ( S l o t _ E x t e r n a l C o m m a n d s )   =   " " 
 
 R e t u r n 
 
 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%  %%%%  %%%%  %%  %%
 
 '   Q%    S A Y                                                                               Q%  %%%%  %%%%    %%%
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%  %%%%  %    %      %
 
 L a b e l   S a y 
 
 	 T T S   S e l e c t V o i c e   " E N G F " 
 
 	 T T S   S p e a k   " T o d a y   i s   a   b e a u t i f u l   d a y   b e c a u s e   w e   s p e n d   t i m e   t o g e t h e r . " 
 
 	 W a i t   T T S r e a d y 
 
 	 
 
 	 T T S   S e l e c t V o i c e   " I T A   F E M " 
 
 	 T T S   S p e a k   " O g g i      u n a   b e l l a   g i o r n a t a   p e r c h e   p a s s e r e m o   d e l   t e m p o   i n s i e m e . " 
 
 	 W a i t   T T S r e a d y 
 
 	 
 
 	 T T S   S e l e c t V o i c e   " J P N " 
 
 	 T T S   S p e a k   " y_0a0o0 N}k0Bf0NT0Y0n0g00Neo0W0D0eg0Y00" 
 
 	 W a i t   T T S r e a d y 
 
 	 
 
 	 T T S   S e l e c t V o i c e   " Z H O " 
 
 	 T T S   S p e a k   " N)Y/f}Yv N)YV:NbNqQ^eIQ0" 
 
 	 W a i t   T T S r e a d y 
 
 R e t u r n 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%W%  %      %  %%%%  %  %%%%  %%%%      %%%%  %    %  %%%%%
 
 '   Q%  V o i c e   O U T   Q%    %  %    %    %  %  %        %%%        %    %  %    %      %
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%]%      %      %%%%  %  %%%%  %%%%      %%%%  %%%%      %
 
 V a r i a b l e   S t r i n g   V o i c e O u t p u t S t a t u s 
 
 L a b e l   S t a r t V o i c e 
 
 	 T T S   S e t V o l u m e   1 0 0 
 
 	 V o i c e O u t p u t S t a t u s   =   " " 
 
 	 V o i c e O u t p u t O n O f f 
 
 R e t u r n 
 
 
 
 L a b e l   S t o p V o i c e 
 
 	 T T S   S e t V o l u m e   0 
 
 	 V o i c e O u t p u t S t a t u s   =   " a c t i v e " 
 
 	 V o i c e O u t p u t O n O f f 
 
 R e t u r n 
 
 
 
 L a b e l   V o i c e O u t p u t O n O f f 
 
 	 I f   V o i c e O u t p u t S t a t u s   =   " a c t i v e " 
 
 	 	 V o i c e O u t p u t S t a t u s   =   " " 
 
 	 	 B u t t o n   V o i c e O u t p u t O n O f f   T e x t   " V o i c e   o u t p u t   O F F " 
 
 	 	 B u t t o n   V o i c e O u t p u t O n O f f   C o l o r   D a r k S l a t e G r a y 
 
 	 	 T T S   S e t V o l u m e   0 
 
 	 E l s e 
 
 	 	 V o i c e O u t p u t S t a t u s   =   " a c t i v e " 
 
 	 	 B u t t o n   V o i c e O u t p u t O n O f f   T e x t   " V o i c e   o u t p u t   O N " 
 
 	 	 B u t t o n   V o i c e O u t p u t O n O f f   C o l o r   L i m e 
 
 	 	 T T S   S e t V o l u m e   1 0 0 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 
 
 
 
 ' L a b e l   L a n g u a g e 
 
 ' 	 I f   C u r r e n t L a n g u a g e   =   " E n g l i s h " 
 
 ' 	 	 C u r r e n t L a n g u a g e   =   " C h i n e s e " 
 
 ' 	 	 B u t t o n   L a n g u a g e   T e x t   " C h i n e s e " 
 
 ' 	 	 B u t t o n   L a n g u a g e   C o l o r   F l a s h i n g     F i r e b r i c k     T h i s t l e 
 
 ' 	 	 T T S   S e l e c t V o i c e   " Z H O " 
 
 ' 	 	 T T S   S p e a k   -Ne 
 
 ' 	 E l s e 
 
 ' 	 	 C u r r e n t L a n g u a g e   =   " C h i n e s e " 
 
 ' 	 	 C u r r e n t L a n g u a g e   =   " E n g l i s h " 
 
 ' 	 	 B u t t o n   L a n g u a g e   T e x t   " E n g l i s h " 
 
 ' 	 	 B u t t o n   L a n g u a g e   C o l o r   D o d g e r B l u e 
 
 ' 	 	 T T S   S e l e c t V o i c e   " E N G " 
 
 ' 	 	 T T S   S p e a k   E n g l i s h   L a n g u a g e 
 
 ' 	 E n d I f 
 
 ' R e t u r n 
 
 
 
 
 
 
 
 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     H O M E     M 1   M 2   M 3   M 4 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   A l l Z e r o 
 
 	 D i s a b l e A l l B u t t o n s 
 
 	 M 1 _ H o m e 
 
 	 M 2 _ H o m e 
 
 	 M 3 _ H o m e 
 
 	 M 4 _ H o m e 
 
 	 ' W a i t A l l M o t o r s 
 
 	 E n a b l e A l l B u t t o n s 
 
 	 T T S   S p e a k W a i t   " H o m i n g   o f   a l l   a x i s   i s   d o n e " 
 
 R e t u r n 
 
 
 
 L a b e l   M 1 _ H o m e 
 
 	 D i s a b l e A l l B u t t o n s 
 
 	 B u t t o n   M 1 _ H o m e   C o l o r   F l a s h i n g 8   Y e l l o w 1   Y e l l o w 5 
 
 	 T T S   S p e a k   " H o m i n g   I n   O u t   s t a r t e d " 
 
 	 S p e e d S e a r c h   =   - 0 . 8 
 
 	 S p e e d R e t u r n   =   + 0 . 1 
 
 	 D e t a c h F r o m S e n s o r   =   + 1 0 
 
 	 I n i t i a l P o s i t i o n   =   1 0 0 
 
 	 H o m e M o t o r ( S l o t _ L i m i t O u t ) ( S l o t _ M 1 _ I n O u t D e s t i ) 
 
 	 T T S   S p e a k W a i t   " H o m i n g   I n   O u t   d o n e " 
 
 	 B u t t o n   M 1 _ H o m e   C o l o r   Y e l l o w 
 
 	 E n a b l e A l l B u t t o n s 
 
 R e t u r n 
 
 
 
 L a b e l   M 2 _ H o m e 
 
 	 D i s a b l e A l l B u t t o n s 
 
 	 B u t t o n   M 2 _ H o m e   C o l o r   F l a s h i n g 8   Y e l l o w 1   Y e l l o w 5 
 
 	 T T S   S p e a k   " H o m i n g   o f   r o t a t i n g   s h a f t   s t a r t e d " 
 
 	 S p e e d S e a r c h   =   - 0 . 1 
 
 	 S p e e d R e t u r n   =   + 0 . 0 5 
 
 	 D e t a c h F r o m S e n s o r   =   + 1 
 
 	 I n i t i a l P o s i t i o n   =   5 
 
 	 H o m e M o t o r ( S l o t _ L i m i t R o t ) ( S l o t _ M 2 _ R o t D e s t i n a ) 
 
 	 S l o t ( S l o t _ M 2 _ R o t D e s t i n a )   =   1 8 0 
 
 	 T T S   S p e a k W a i t   " R o t a t i n g   H o m e   d o n e " 
 
 	 B u t t o n   M 2 _ H o m e   C o l o r   Y e l l o w 
 
 	 E n a b l e A l l B u t t o n s 
 
 R e t u r n 
 
 
 
 L a b e l   M 3 _ H o m e 
 
 	 D i s a b l e A l l B u t t o n s 
 
 	 B u t t o n   M 3 _ H o m e   C o l o r   F l a s h i n g 8   Y e l l o w 1   Y e l l o w 5 
 
 	 T T S   S p e a k   " H o m i n g   o f   T i p " 
 
 	 S l o t ( S l o t _ M 3 _ T i p D e s t i n a )   =   - 1 1 0 
 
 	 G o s u b   W a i t M o t o r ( S l o t _ M 3 _ T i p D e s t i n a ) 
 
 	 S l o t ( S l o t _ M 3 _ T i p D e s t i n a )   =   R e s e t 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 S l o t ( S l o t _ M 3 _ T i p D e s t i n a )   =   0 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 T T S   S p e a k W a i t   " T i p   h o m e   d o n e " 
 
 	 S l o t ( S l o t _ M 3 _ T i p D e s t i n a )   =   6 0 
 
 	 B u t t o n   M 3 _ H o m e   C o l o r   Y e l l o w 
 
 	 E n a b l e A l l B u t t o n s 
 
 R e t u r n 
 
 
 
 L a b e l   M 4 _ H o m e 
 
 	 D i s a b l e A l l B u t t o n s 
 
 	 B u t t o n   M 4 _ H o m e   C o l o r   F l a s h i n g 8   Y e l l o w 1   Y e l l o w 5 
 
 	 T T S   S p e a k   " H o m i n g   o f   E l e v a t i o n " 
 
 	 S p e e d S e a r c h   =   - 0 . 2 
 
 	 S p e e d R e t u r n   =   + 0 . 0 1 
 
 	 D e t a c h F r o m S e n s o r   =   + 1 0 
 
 	 I n i t i a l P o s i t i o n   =   2 0 0 
 
 	 H o m e M o t o r ( S l o t _ L i m i t E l e v ) ( S l o t _ M 4 _ E l e v D e s t i n ) 
 
 	 T T S   S p e a k W a i t   " E l e v a t i o n   h o m e   d o n e " 
 
 	 B u t t o n   M 4 _ H o m e   C o l o r   Y e l l o w 
 
 	 E n a b l e A l l B u t t o n s 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     H o m e   t h e   M o t o r 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   S p e e d S e a r c h 
 
 V a r i a b l e   N u m e r i c   S p e e d R e t u r n 
 
 V a r i a b l e   N u m e r i c   D e t a c h F r o m S e n s o r 
 
 V a r i a b l e   N u m e r i c   I n i t i a l P o s i t i o n 
 
 
 
 L a b e l   H o m e M o t o r 
 
 	 V a r i a b l e   N u m e r i c   S l o t L i m i t 
 
 	 V a r i a b l e   N u m e r i c   S l o t D e s t 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - -   d e t a c h   i f   s e n s o r   i s   a c t i v e 
 
 	 I f   S l o t ( S l o t L i m i t )   >   5 0 0   O r   K e y ( " C T R L " ) 
 
 	 	 S l o t ( S l o t D e s t )   =   S l o t ( S l o t D e s t )   +   S p e e d R e t u r n 
 
 	 E n d I f 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   s e a r c h   t h e   s e n s o r 
 
 L a b e l   S e a r c h H o m e 
 
 	 S l o t ( S l o t D e s t )   =   S l o t ( S l o t D e s t )   +   S p e e d S e a r c h 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t ( S l o t L i m i t )   >   5 0 0   O r   K e y ( " C T R L " ) 
 
 	 	 S l o t ( S l o t D e s t )   =   R e s e t 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 	 S l o t ( S l o t D e s t )   =   0 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 	 G o t o   D e t a c h S e n s o r 
 
 	 E n d I f 
 
 G o t o   S e a r c h H o m e 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   d e t a c h   f r o m   t h e   s e n s o r 
 
 L a b e l   D e t a c h S e n s o r 
 
 	 S l o t ( S l o t D e s t )   =   S l o t ( S l o t D e s t )   +   S p e e d R e t u r n 
 
 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 I f   S l o t   ( S l o t L i m i t )   <   5 0 0 
 
 	 	 S l o t ( S l o t D e s t )   =   R e s e t 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 	 S l o t ( S l o t D e s t )   =   - D e t a c h F r o m S e n s o r 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 	 G o t o   S e t F i n a l V a l u e s 
 
 	 E n d I f 
 
 G o t o   D e t a c h S e n s o r 
 
         '   - - - - - - - - - - - - - - - - - - - - - - - - -   r e s e t   a n d   m o v e   t o   I n i t i a l P o s 
 
 L a b e l   S e t F i n a l V a l u e s 
 
 	 S l o t ( S l o t D e s t )   =   I n i t i a l P o s i t i o n 
 
 	 G o s u b   W a i t M o t o r ( S l o t D e s t ) 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       W a i t   u n t i l   t h e   m o t o r   i s   s t o p p e d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   W a i t M o t 1 
 
 L a b e l   W a i t M o t o r 
 
 	 V a r i a b l e   N u m e r i c   W a i t M o t o r _ S l o t D e s t 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 F o r   W a i t M o t 1   =   1   T o   9 e 9 9 
 
 	 	 I f   A b s ( S l o t ( W a i t M o t o r _ S l o t D e s t   +   1 ) )   <   0 . 0 1 
 
 	 	 	 E x i t 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 0 5 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%  %      %  %  %%%%  %%%%%      %%%%  %%    %  %%%%
 
 '   Q%    V I R T U A L   E N C O D E R                                                       Q%    %  %    %  %%%%      %          %%%    %  %%%  %
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%      %      %  %  %%      %    %    %%%%  %      %  %%%%  %
 
 L a b e l   U p d a t e P o s i t i o n s 
 
 	 B u t t o n   M 1 _ D e s t i n a t i o n   T e x t   F o r m a t ( S l o t ( S l o t _ M 1 _ I n O u t D e s t i ) ,   " 0 0 0 0 . 0 0 "   +   " m m " ) 
 
 	 B u t t o n   M 1 _ P o s i t i o n   T e x t   F o r m a t ( S l o t ( S l o t _ M 1 _ I n O u t P o s i t ) ,   " 0 0 0 0 . 0 0 " )   +   " m m " 
 
 	 
 
 	 B u t t o n   M 2 _ D e s t i n a t i o n   T e x t   F o r m a t ( S l o t ( S l o t _ M 2 _ R o t D e s t i n a ) ,   " 0 0 0 . 0 0 "   +   "  " ) 
 
 	 B u t t o n   M 2 _ P o s i t i o n   T e x t   F o r m a t ( S l o t ( S l o t _ M 2 _ R o t P o s i t i o ) ,   " 0 0 0 . 0 0 " )   +   "  " 
 
 	 
 
 	 B u t t o n   M 3 _ D e s t i n a t i o n   T e x t   F o r m a t ( S l o t ( S l o t _ M 3 _ T i p D e s t i n a ) ,   " 0 0 0 . 0 0 "   +   "  " ) 
 
 	 B u t t o n   M 3 _ P o s i t i o n   T e x t   F o r m a t ( S l o t ( S l o t _ M 3 _ T i p P o s i t i o ) ,   " 0 0 0 . 0 0 " )   +   "  " 
 
 	 
 
 	 B u t t o n   M 4 _ D e s t i n a t i o n   T e x t   F o r m a t ( S l o t ( S l o t _ M 4 _ E l e v D e s t i n ) ,   " 0 0 0 0 . 0 0 "   +   " m m " ) 
 
 	 B u t t o n   M 4 _ P o s i t i o n   T e x t   F o r m a t ( S l o t ( S l o t _ M 4 _ E l e v P o s i t i ) ,   " 0 0 0 0 . 0 " )   +   " m m " 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '       W a i t   u n t i l   a l l   m o t o r s   a r e   s t o p p e d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   W a i t A l l M o t o r s 
 
 	 W a i t   S e c o n d s   0 . 0 5 
 
 	 V a r i a b l e   N u m e r i c   W M 1 
 
 	 F o r   W M 1   =   1   T o   9 e 9 9 
 
 	 	 I f   A b s ( S l o t ( S l o t _ M 1 _ I n O u t P o s i t ) )   <   0 . 0 1 
 
 	 	 	 I f   A b s ( S l o t ( S l o t _ M 2 _ R o t P o s i t i o ) )   <   0 . 0 1 
 
 	 	 	 	 I f   A b s ( S l o t ( S l o t _ M 3 _ T i p P o s i t i o ) )   <   0 . 0 1 
 
 	 	 	 	 	 I f   A b s ( S l o t ( S l o t _ M 4 _ E l e v P o s i t i ) )   <   0 . 0 1 
 
 	 	 	 	 	 	 E x i t 
 
 	 	 	 	 	 E n d I f 
 
 	 	 	 	 E n d I f 
 
 	 	 	 E n d I f 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 0 0 1 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     P R I N T   C O O R D I N A T E S 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 L a b e l   P r i n t V a l u e s 
 
 ' 	 s 1   =               " X = "   +   F o r m a t ( S l o t ( S l o t _ X ) ,   " 0 . 0 0 0 " ) 
 
 ' 	 s 1   =   s 1   +   "   Y = "   +   F o r m a t ( S l o t ( S l o t _ Y ) ,   " 0 . 0 0 0 " ) 
 
 ' 	 s 1   =   s 1   +   "   Z = "   +   F o r m a t ( S l o t ( S l o t _ Z ) ,   " 0 . 0 0 0 " ) 
 
 	 s 1   =   s 1   +   "       " 
 
 ' 	 s 1   =   s 1   +   "   M 0 e r r = "   +   F o r m a t ( S l o t ( S l o t _ C o u n t e r R e a d e r O u t M 0 )   -   S l o t ( S l o t _ M 0 ) ,   " 0 . 0 0 0 " ) 
 
 ' 	 s 1   =   s 1   +   "   M 1 e r r = "   +   F o r m a t ( S l o t ( S l o t _ C o u n t e r R e a d e r O u t M 1 )   -   S l o t ( S l o t _ M 1 ) ,   " 0 . 0 0 0 " ) 
 
 ' 	 s 1   =   s 1   +   "   M 2 e r r = "   +   F o r m a t ( S l o t ( S l o t _ C o u n t e r R e a d e r O u t M 2 )   -   S l o t ( S l o t _ M 2 ) ,   " 0 . 0 0 0 " ) 
 
 	 
 
 	 P r i n t   C R L F   +   s 1 
 
 R e t u r n 
 
 
 
 ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '     J o y P a d 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 V a r i a b l e   N u m e r i c   J o y P a d _ S p e e d M u l t 
 
 V a r i a b l e   N u m e r i c   J o y P a d _ X 0 
 
 V a r i a b l e   N u m e r i c   J o y P a d _ Y 0 
 
 V a r i a b l e   N u m e r i c   J o y P a d _ T 0 
 
 
 
 V a r i a b l e   N u m e r i c   J o y P a d _ V 1 
 
 V a r i a b l e   N u m e r i c   J o y P a d _ V 2 
 
 V a r i a b l e   N u m e r i c   J o y P a d _ V 3 
 
 V a r i a b l e   S t r i n g   J o y P a d _ S t a t u s   =   " O F F " 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   S o f t w a r e   l i m i t s 
 
 V a r i a b l e   N u m e r i c   Y m a x   =   2 1 4 5 
 
 V a r i a b l e   N u m e r i c   Y m i n   =   5 
 
 V a r i a b l e   N u m e r i c   X m a x   =   3 2 5 
 
 V a r i a b l e   N u m e r i c   X m i n   =   5 
 
 V a r i a b l e   N u m e r i c   T m a x   =   1 0 5 
 
 V a r i a b l e   N u m e r i c   T m i n   =   5 
 
 V a r i a b l e   N u m e r i c   E m a x   =   3 0 0 
 
 V a r i a b l e   N u m e r i c   E m i n   =   5 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   J o y P a d   S t a r t / S t o p 
 
 L a b e l   J o y P a d _ E n a b l e 
 
 	 I f   J o y P a d _ S t a t u s   =   " O N " 
 
 	 	 J o y P a d _ S t a t u s   =   " O F F " 
 
 	 	 B u t t o n   J o y P a d _ E n a b l e   T e x t   " J o y P a d   O F F " 
 
 	 	 B u t t o n   J o y P a d _ E n a b l e   C o l o r   F l a s h i n g   R e d     R e d 4 
 
 	 E l s e 
 
 	 	 J o y P a d _ S t a t u s   =   " O N " 
 
 	 	 B u t t o n   J o y P a d _ E n a b l e   T e x t   " J o y P a d   O N " 
 
 	 	 B u t t o n   J o y P a d _ E n a b l e   C o l o r   G r e e n 9 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 L a b e l   C h e c k S t a t u s J o y P a d 
 
 	 I f   S l o t ( S l o t _ J o y B t n 1 2 )   >   5 0 0 
 
 	 	 J o y P a d _ E n a b l e 
 
 	 	 W a i t   S l o t ( S l o t _ J o y B t n 1 2 )   <   5 0 0 
 
 	 E n d I f 
 
 R e t u r n 
 
 
 
 L a b e l   J o y P a d 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   J o y P a d   I n i t i a l i z a t i o n s 
 
 	 J o y P a d _ X 0   =   S l o t ( S l o t _ J o y P a d X ) 
 
 	 J o y P a d _ Y 0   =   S l o t ( S l o t _ J o y P a d Y ) 
 
 	 J o y P a d _ T 0   =   S l o t ( S l o t _ J o y P a d T ) 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   J o y P a d   Z e r o - T e s t 
 
 	 I f   J o y P a d _ X 0   >   5 5 0   O r   J o y P a d _ X 0   <   4 5 0 
 
 	 	 P r i n t   " J o y P a d   E r r o r   :   X   =   "   +   I n t ( J o y P a d _ X 0 ) 
 
 	 	 J o y P a d _ S t a t u s   =   " O F F " 
 
 	 E n d I f 
 
 	 I f   J o y P a d _ Y 0   >   5 5 0   O r   J o y P a d _ Y 0   <   4 5 0 
 
 	 	 P r i n t   " J o y P a d   E r r o r   :   Y   =   "   +   I n t ( J o y P a d _ Y 0 ) 
 
 	 	 J o y P a d _ S t a t u s   =   " O F F " 
 
 	 E n d I f 
 
 	 I f   J o y P a d _ T 0   >   5 5 0   O r   J o y P a d _ T 0   <   4 5 0 
 
 	 	 P r i n t   " J o y P a d   E r r o r   :   T   =   "   +   I n t ( J o y P a d _ T 0 ) 
 
 	 	 J o y P a d _ S t a t u s   =   " O F F " 
 
 	 E n d I f 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   J o y P a d   E x e c u t i o n 
 
 	 F o r   J o y P a d _ V 1   =   1   T o   I n f i n i t y 
 
 	 	 I f   J o y P a d _ S t a t u s   =   " O F F " 
 
 	 	 	 E x i t 
 
 	 	 E n d I f 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 	 W a i t   S e c o n d s   0 . 0 1 
 
 	 	 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   L o g a r i t m i c   s p e e d   a d j u s t m e n t 
 
 	 	 J o y P a d _ S p e e d M u l t   =   S l o t ( S l o t _ J o y P a d S p e e d )   /   1 0 0 0   -   0 . 5 
 
 	 	 J o y P a d _ S p e e d M u l t   =   P o w ( 1 0 ,   J o y P a d _ S p e e d M u l t ) 
 
 	 	 
 
                 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   J o y P a d   A x i s   y 
 
 	 	 J o y P a d _ V 2   =   S l o t ( S l o t _ J o y P a d Y )   -   J o y P a d _ Y 0 
 
 	 	 J o y P a d _ V 3   =   A b s ( J o y P a d _ V 2 )   -   J o y P a d _ D e a d B a n d 
 
 	 	 I f   J o y P a d _ V 3   >   0 
 
 	 	 	 J o y P a d _ V 3   =   J o y P a d _ V 3   *   J o y P a d _ S p e e d   *   J o y P a d _ S p e e d M u l t   *   0 . 0 0 0 0 5 
 
 	 	 	 S l o t ( S l o t _ M 1 _ I n O u t D e s t i )   =   L i m i t ( S l o t ( S l o t _ M 1 _ I n O u t D e s t i )   -   J o y P a d _ V 3   *   S i g n ( J o y P a d _ V 2 ) ,   Y m i n ,   Y m a x ) 
 
 	 	 E n d I f 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   J o y P a d   A x i s   X 
 
 	 	 J o y P a d _ V 2   =   S l o t ( S l o t _ J o y P a d X )   -   J o y P a d _ X 0 
 
 	 	 J o y P a d _ V 3   =   A b s ( J o y P a d _ V 2 )   -   J o y P a d _ D e a d B a n d 
 
 	 	 I f   J o y P a d _ V 3   >   0 
 
 	 	 	 J o y P a d _ V 3   =   J o y P a d _ V 3   *   J o y P a d _ S p e e d   *   J o y P a d _ S p e e d M u l t   *   0 . 0 0 0 1 
 
 	 	 	 S l o t ( S l o t _ M 2 _ R o t D e s t i n a )   =   L i m i t ( S l o t ( S l o t _ M 2 _ R o t D e s t i n a )   +   J o y P a d _ V 3   *   S i g n ( J o y P a d _ V 2 ) ,   X m i n ,   X m a x ) 
 
 	 	 E n d I f 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   J o y P a d   A x i s   T 
 
 	 	 J o y P a d _ V 2   =   S l o t ( S l o t _ J o y P a d T )   -   J o y P a d _ T 0 
 
 	 	 J o y P a d _ V 3   =   A b s ( J o y P a d _ V 2 )   -   J o y P a d _ D e a d B a n d 
 
 	 	 I f   J o y P a d _ V 3   >   0 
 
 	 	 	 J o y P a d _ V 3   =   J o y P a d _ V 3   *   J o y P a d _ S p e e d   *   J o y P a d _ S p e e d M u l t   *   0 . 0 0 0 0 1 
 
 	 	 	 S l o t ( S l o t _ M 3 _ T i p D e s t i n a )   =   L i m i t ( S l o t ( S l o t _ M 3 _ T i p D e s t i n a )   +   J o y P a d _ V 3   *   S i g n ( J o y P a d _ V 2 ) ,   T m i n ,   T m a x ) 
 
 	 	 E n d I f 
 
 	 	 
 
                 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   J o y P a d   A x i s   E 
 
 	 	 S e l e c t   S l o t ( S l o t _ J o y P a d 8 W ) 
 
 	 	 	 C a s e   3 6 0 
 
 	 	 	 	 S l o t ( S l o t _ M 4 _ E l e v D e s t i n )   =   L i m i t ( S l o t ( S l o t _ J o y P a d 8 W )   +   J o y P a d _ S p e e d   *   J o y P a d _ S p e e d M u l t   *   0 . 0 0 1 ,   E m i n ,   E m a x ) 
 
 	 	 	 	 
 
 	 	 	 C a s e   1 8 0 
 
 	 	 	 	 S l o t ( S l o t _ M 4 _ E l e v D e s t i n )   =   L i m i t ( S l o t ( S l o t _ J o y P a d 8 W )   -   J o y P a d _ S p e e d   *   J o y P a d _ S p e e d M u l t   *   0 . 0 0 1 ,   E m i n ,   E m a x ) 
 
 	 	 E n d S e l e c t 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   J o y P a d   O p e n / C l o s e   c o o r d i n a t e   t e x t   b o x 
 
 ' V a r i a b l e   N u m e r i c   T e x t B o x I s O p e n e d 
 
 ' 	 I f   S l o t ( S l o t _ J o y P a d T e x B o x )   >   5 0 0 
 
 ' I f   T e x t B o x I s O p e n e d   =   0 
 
 ' C o n t r o l s   O p e n T e x t B o x 
 
 ' T e x t B o x I s O p e n e d   =   1 
 
 ' E l s e 
 
 ' C o n t r o l s   C l o s e T e x t B o x 
 
 ' T e x t B o x I s O p e n e d   =   0 
 
 ' E n d I f 
 
 ' 	 W a i t   S l o t ( S l o t _ J o y P a d T e x B o x )   <   5 0 0 
 
 ' E n d I f 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   J o y P a d   S v e   c o o r d i n a t e   o n   a   f i l e 
 
 ' I f   S l o t ( S l o t _ J o y P a d S a v e C o o r d )   >   5 0 0 
 
 ' 	 	 	 s 1   =                 " X     =   "   +   F o r m a t ( S l o t ( S l o t _ X ) ,   " 0 . 0 0 " ) 
 
 ' 	 	 	 s 1   =   s 1   +   "     Y     =   "   +   F o r m a t ( S l o t ( S l o t _ Y ) ,   " 0 . 0 0 " ) 
 
 ' 	 	 	 s 1   =   s 1   +   "     Z     =   "   +   F o r m a t ( S l o t ( S l o t _ Z ) ,   " 0 . 0 0 " ) 
 
 ' 	 	 	 S a v e   S t r i n g T o F i l e   s 1   F i l e N a m e 
 
 ' W a i t   S l o t ( S l o t _ J o y P a d S a v e C o o r d )   <   5 0 0 
 
 ' E n d I f 
 
 ' 
 
 ' '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   J o y P a d   W h i t e   F r o n t   b u t t o n 
 
 ' I f   S l o t ( S l o t _ J o y P a d F r o n t W h i t e )   >   5 0 0 
 
 ' 	 S l o t ( S l o t _ W h i t e F r o n t )   =   1 0 0 0   -   S l o t ( S l o t _ W h i t e F r o n t ) 
 
 ' 	 W a i t   S l o t ( S l o t _ J o y P a d F r o n t W h i t e )   <   5 0 0 
 
 ' E n d I f 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - -   d e t a c h   f r o m   t h e   s e n s o r 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   J o y P a d   D i s p e n s e r   B u t t o n 
 
 ' 	 	 S l o t ( S l o t _ D i s p e n s e r )   =   S l o t ( S l o t _ J o y P a d D i s p e n s e r ) 
 
 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   J o y P a d   F i n a l i z a t i o n s 
 
 ' B u t t o n   J o y P a d   T e x t   J o y P a d 
 
 ' B u t t o n   J o y P a d   C o l o r   O r a n g e 
 
 ' 	 G o s u b   W h i t e F r o n t O F F 
 
 ' 	 G o s u b   B l u O f f 
 
 
 
 
 
 ' = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   V I D E O 
 
 L a b e l   S t a r t V i d e o 
 
 	 S l o t ( S l o t _ S t a r t S t o p V i d e o )   =   1 0 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   S t o p V i d e o 
 
 	 S l o t ( S l o t _ S t a r t S t o p V i d e o )   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   S a v e V i d e o 
 
 	 S l o t ( S l o t _ S a v e V i d e o )   =   1 0 0 0 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 S l o t ( S l o t _ S a v e V i d e o )   =   0 
 
 R e t u r n 
 
 
 
 L a b e l   T a k e I m a g e 
 
 	 W a i t   S e c o n d s   1 . 5 
 
 	 S l o t ( S l o t _ T a k e I m a g e )   =   1 0 0 0 
 
 	 W a i t   S e c o n d s   0 . 2 
 
 	 S l o t ( S l o t _ T a k e I m a g e )   =   0 
 
 R e t u r n 
 
 '   T%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%W%  %%%%%  %%%%  %  %%%%  %
 
 '   Q%  T   R   I   A   L   S                                                                 Q%      %      %%%%  %  %%%%  %
 
 '   Z%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%P%]%      %      %  %%  %  %    %  %%%
 
 
 
 
 
 ' B O O K M A R K S   
 
 
 
 